/*!
 * \file       ny8a051h.h
 * \brief      NY8A051H header file
 * \author     HuangTing
 * \date       2021/04/9
 * \details    define register
 */

#ifndef NY8A051H_H_S5PBG7ND
#define NY8A051H_H_S5PBG7ND

#ifndef __CPU_HAS_SET
#  ifdef __SDCC
#    warning "Use NY8.h instead of <icbody>.h for consistency."
#  endif
#endif

#include <ny8common.h>

extern __at(0x0000) __sfr INDF;

extern __at(0x0001) __sfr TMR0;

extern __at(0x0002) __sfr PCL;

extern __at(0x0003) __sfr STATUS;

extern __at(0x0004) __sfr FSR;

typedef struct __PORTBbits_t
{
    unsigned PB0      : 1;
    unsigned PB1      : 1;
    unsigned PB2      : 1;
    unsigned PB3      : 1;
    unsigned PB4      : 1;
    unsigned PB5      : 1;
    unsigned          : 1;
    unsigned          : 1;
} __PORTBbits_t;

extern __at(0x0006) volatile __PORTBbits_t PORTBbits;
extern __at(0x0006) __sfr PORTB;
__sbit PB0    = PORTB : 0;
__sbit PB1    = PORTB : 1;
__sbit PB2    = PORTB : 2;
__sbit PB3    = PORTB : 3;
__sbit PB4    = PORTB : 4;
__sbit PB5    = PORTB : 5;

typedef struct __PCONbits_t
{
    unsigned          : 1;
    unsigned          : 1;
    unsigned CMPEN    : 1;
    unsigned LVREN    : 1;
    unsigned          : 1;
    unsigned LVDEN    : 1;
    unsigned EIS      : 1;
    unsigned WDTEN    : 1;
} __PCONbits_t;

extern __at(0x0008) volatile __PCONbits_t PCONbits;
extern __at(0x0008) __sfr PCON;
__sbit CMPEN  = PCON : 2;
__sbit LVREN  = PCON : 3;
__sbit LVDEN  = PCON : 5;
__sbit EIS    = PCON : 6;
__sbit WDTEN  = PCON : 7;

typedef struct __BWUCONbits_t
{
    unsigned WUPB0    : 1;
    unsigned WUPB1    : 1;
    unsigned WUPB2    : 1;
    unsigned WUPB3    : 1;
    unsigned WUPB4    : 1;
    unsigned WUPB5    : 1;
    unsigned          : 1;
    unsigned          : 1;
} __BWUCONbits_t;

extern __at(0x0009) volatile __BWUCONbits_t BWUCONbits;
extern __at(0x0009) __sfr BWUCON;
__sbit WUPB0  = BWUCON : 0;
__sbit WUPB1  = BWUCON : 1;
__sbit WUPB2  = BWUCON : 2;
__sbit WUPB3  = BWUCON : 3;
__sbit WUPB4  = BWUCON : 4;
__sbit WUPB5  = BWUCON : 5;

extern __at(0x000A) __sfr PCHBUF;

typedef struct __BPLCONbits_t
{
    unsigned          : 1;
    unsigned          : 1;
    unsigned          : 1;
    unsigned          : 1;
    unsigned PLPB0    : 1;
    unsigned PLPB1    : 1;
    unsigned PLPB2    : 1;
    unsigned PLPB3    : 1;
} __BPLCONbits_t;

extern __at(0x000B) volatile __BPLCONbits_t BPLCONbits;
extern __at(0x000B) __sfr BPLCON;
__sbit PLPB0  = BPLCON : 4;
__sbit PLPB1  = BPLCON : 5;
__sbit PLPB2  = BPLCON : 6;
__sbit PLPB3  = BPLCON : 7;

typedef struct __BPHCONbits_t
{
    unsigned PHPB0    : 1;
    unsigned PHPB1    : 1;
    unsigned PHPB2    : 1;
    unsigned PHPB3    : 1;
    unsigned PHPB4    : 1;
    unsigned PHPB5    : 1;
    unsigned          : 1;
    unsigned          : 1;
} __BPHCONbits_t;

extern __at(0x000C) volatile __BPHCONbits_t BPHCONbits;
extern __at(0x000C) __sfr BPHCON;
__sbit PHPB0  = BPHCON : 0;
__sbit PHPB1  = BPHCON : 1;
__sbit PHPB2  = BPHCON : 2;
__sbit PHPB3  = BPHCON : 3;
__sbit PHPB4  = BPHCON : 4;
__sbit PHPB5  = BPHCON : 5;

typedef struct __INTEbits_t
{
    unsigned T0IE     : 1;
    unsigned PBIE     : 1;
    unsigned INTIE    : 1;
    unsigned T1IE     : 1;
    unsigned LVDIE    : 1;
    unsigned          : 1;
    unsigned WDTIE    : 1;
    unsigned          : 1;
} __INTEbits_t;

extern __at(0x000E) volatile __INTEbits_t INTEbits;
extern __at(0x000E) __sfr INTE;
__sbit T0IE   = INTE : 0;
__sbit PBIE   = INTE : 1;
__sbit INTIE  = INTE : 2;
__sbit T1IE   = INTE : 3;
__sbit LVDIE  = INTE : 4;
__sbit WDTIE  = INTE : 6;

typedef struct __INTFbits_t
{
    unsigned T0IF     : 1;
    unsigned PBIF     : 1;
    unsigned INTIF    : 1;
    unsigned T1IF     : 1;
    unsigned LVDIF    : 1;
    unsigned          : 1;
    unsigned WDTIF    : 1;
    unsigned          : 1;
} __INTFbits_t;

extern __at(0x000F) volatile __INTFbits_t INTFbits;
extern __at(0x000F) __sfr INTF;
__sbit T0IF   = INTF : 0;
__sbit PBIF   = INTF : 1;
__sbit INTIF  = INTF : 2;
__sbit T1IF   = INTF : 3;
__sbit LVDIF  = INTF : 4;
__sbit WDTIF  = INTF : 6;

extern __at(0x00800006) volatile __fpage IOSTB;

extern __at(0x0080000A) volatile __fpage PS0CV;

extern __at(0x0080000C) volatile __fpage BODCON;

extern __at(0x0080000E) volatile __fpage CMPCR;

extern __at(0x0080000F) volatile __fpage PCON1;

extern __at(0x01000000) volatile __spage TMR1;

extern __at(0x01000001) volatile __spage T1CR1;

extern __at(0x01000002) volatile __spage T1CR2;

extern __at(0x01000003) volatile __spage PWM1DUTY;

extern __at(0x01000004) volatile __spage PS1CV;

extern __at(0x01000005) volatile __spage BZ1CR;

extern __at(0x01000006) volatile __spage IRCR;

extern __at(0x01000007) volatile __spage TBHP;

extern __at(0x01000008) volatile __spage TBHD;

extern __at(0x0100000F) volatile __spage OSCCR;

extern __at(0x00800000) volatile __t0mdpage T0MD;


#endif /* end of include guard: NY8A051H_H_S5PBG7ND */
